<template>
  <div class="center">
    <div style="margin-bottom:20px" class="flex flex_bet felx_align">
      <div style="font-size:22px">SN生成详情</div>
      <el-button type="info" icon="el-icon-close" circle @click="closeInfo"></el-button>
    </div>
    <div class="main">
      <header>SN对应模块信息</header>
      <div class="info">
        <ul class="flex flex-wrap">
          <li><span class="title">产品型号名:</span><span class="vlaue">{{infoData.name}}</span></li>
          <li><span class="title">创建时间:</span><span class="vlaue">{{Number(infoData.create_time) | newDate}}</span></li>
          <li><span class="title">SN生成用途:</span><span class="vlaue">{{FirmwareDate.purpose}}</span></li>
          <li><span class="title">当前SN码:</span><span class="vlaue">{{infoData.sn_value}}</span></li>
          <li><span class="title">MAC地址:</span><span class="vlaue">{{infoData.mac}}</span></li>
          <li><span class="title">IMEI号:</span><span class="vlaue">{{infoData.imei}}</span></li> <!--新增 -->
          <li><span class="title">生成用户:</span><span class="vlaue">{{infoData.username}}</span></li>
          <li><span class="title">前五位拼码:</span><span class="vlaue">{{infoData.digits_str}}</span></li>
          <li><span class="title">最新固件:</span><span class="vlaue">{{FirmwareDate.firmware_version}}</span></li>
          <li><span class="title">是否新的固件制作中:</span><span class="vlaue">{{FirmwareDate.is_make ? '是' : '否'}}</span></li>
        </ul>
      </div>
    </div>

    <div class="main" style="margin-top:20px">
      <header>SN对应物料规格信息</header>
      <div class="info">
        <ul class="flex flex-wrap">
          <li><span class="title">第五位简述:</span><span class="vlaue">{{FirmwareDate.remarks}}</span></li>
        </ul>
      </div>
      <table>
        <tr>
          <th class="table_tilte">物料名</th>
          <th>供应商</th>
          <th>物料规格</th>
        </tr>
        <tr>
          <td class="table_tilte">CUP</td>
          <td>{{FirmwareDate.eCpu}},{{FirmwareDate.sCpu}}</td>
          <td class="specification">{{FirmwareDate.dCpu}}</td>
        </tr>
        <tr>
          <td>运行RAM</td>
          <td>{{FirmwareDate.eStartRam}},{{FirmwareDate.sStartRam}}</td>
          <td class="specification">{{FirmwareDate.dStartRam}}</td>
        </tr>
        <tr>
          <td>存储ROM</td>
          <td>{{FirmwareDate.eStorageRom}},{{FirmwareDate.sStorageRom}}</td>
          <td class="specification">{{FirmwareDate.dStorageRom}}</td>
        </tr>
        <tr>
          <td>显示屏</td>
          <td>{{FirmwareDate.eDisplay}},{{FirmwareDate.sDisplay}}</td>
          <td class="specification">{{FirmwareDate.dDisplay}}</td>
        </tr>
        <tr>
          <td>触摸屏</td>
          <td>{{FirmwareDate.eTouchScreen}},{{FirmwareDate.sTouchScreen}}</td>
          <td class="specification">{{FirmwareDate.dTouchScreen}}</td>
        </tr>
        <tr>
          <td>前摄像头</td>
          <td>{{FirmwareDate.ePrefixCamera}},{{FirmwareDate.sPrefixCamera}}</td>
          <td class="specification">{{FirmwareDate.dPrefixCamera}}</td>
        </tr>
        <tr>
          <td>后摄像头</td>
          <td>{{FirmwareDate.eSuffixCamera}},{{FirmwareDate.sSuffixCamera}}</td>
          <td class="specification">{{FirmwareDate.dSuffixCamera}}</td>
        </tr>
        <tr>
          <td>电池</td>
          <td>{{FirmwareDate.eBattery}},{{FirmwareDate.sBattery}}</td>
          <td class="specification">{{FirmwareDate.dBattery}}</td>
        </tr>
        <tr>
          <td>其他需求</td>
          <td>{{FirmwareDate.eOther}},{{FirmwareDate.sOther}}</td>
          <td class="specification">{{FirmwareDate.dOther}}</td>
        </tr>
      </table>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    infoData: {
      type: Object,
      defaulte() {
        return {}
      }
    },
    FirmwareDate: {
      type: Object,
      defaulte() {
        return {}
      }
    }
  },
  data() {
    return {

    }
  },
  methods: {
    closeInfo() {
      this.$emit('closeInfo')
    }
  }
}
</script>

<style scoped lang="scss">
.main {
  background-color: #f8f8f8;
  padding: 20px;
  border-radius: 8px;
  header {
    //font-weight: 600;
  }
  .info {
    ul {
      font-size: 14px;
      li {
        width: 33%;
        margin-top: 20px;
        .title {
          margin-right: 10px;
        }
        .vlaue {
          color: #575858;
          display: inline-block;
          margin-right: 10px;
        }
      }
    }
  }
  table {
    min-width: 80%;
    border-collapse: collapse;
    margin-top: 10px;
    tr {
      margin-top: 10px;
    }
    th {
      font-weight: 500;
      border: 1px solid #999999;
      line-height: 40px;
      font-size: 13px;
    }
    td {
      text-align: center;
      line-height: 40px;
      border: 1px solid #999999;
      font-size: 14px;
      color: #575858;
      font-size: 12px;
    }
    .specification {
      max-width: 300px;
      word-break: break-word;
    }
    .table_tilte {
      width: 100px;
    }
  }
}
</style>